package com.weixing.mall.provider.model.excel;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.weixing.mall.base.constant.DatePattern;
import com.weixing.mall.base.enums.IsEnableEnum;
import com.weixing.mall.base.enums.WhetherEnum;
import com.weixing.mall.provider.api.model.enums.AgentLevelEnum;
import com.weixing.mall.provider.api.model.enums.IsOfficialEnum;
import lombok.Data;

import java.util.Date;

/**
 * 代理开户
 */
@Data
public class AgentED {
    @ExcelProperty("代理商优惠ID")
    private String agentSn;

    @ExcelProperty("是否绑定代理商")
    @ExcelIgnore
    private WhetherEnum isBind;
    @ExcelProperty("是否绑定代理商")
    private String isBindStr;
    @ExcelProperty("客服名称")
    private String customerName;
    @ExcelProperty("代理商名称")
    private String agentName;
    @ExcelProperty("上级代理商")
    private String parentName;
    @ExcelProperty("手机号")
    private String mobile;
    @ExcelProperty("微信号")
    private String wechatNum;
    @ExcelProperty("开户时间")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = DatePattern.NORM_DATETIME_PATTERN)
    private Date createdTime;
    @ExcelProperty("生效时间")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = DatePattern.NORM_DATETIME_PATTERN)
    private Date effectTime;
    @ExcelProperty("到期时间")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = DatePattern.NORM_DATETIME_PATTERN)
    private Date maturityTime;
    @ExcelProperty("代理等级")
    @ExcelIgnore
    private AgentLevelEnum agentLevel;
    @ExcelProperty("代理等级")
    private String agentLevelStr;
    @ExcelProperty("邮箱")
    private String email;
    @ExcelProperty("代理状态")
    @ExcelIgnore
    private IsEnableEnum isEnable;
    @ExcelProperty("代理状态")
    private String isEnableStr;
    @ExcelProperty("是否正式")
    @ExcelIgnore
    private IsOfficialEnum isOfficial;
    @ExcelProperty("是否正式")
    private String isOfficialStr;
    @ExcelProperty("身份证号")
    private String idCard;
    @ExcelProperty("所属省")
    private String province;
    @ExcelProperty("所属市")
    private String city;
    @ExcelProperty("详细地址")
    private String addr;
    @ExcelProperty("备注")
    private String remark;


    public void setIsBind(WhetherEnum isBind){
        this.isBind = isBind;
        if(isBind != null){
            this.isBindStr = isBind.getDesp();
        }
    }

    public void setAgentLevel(AgentLevelEnum agentLevel){
        this.agentLevel = agentLevel;
        if(agentLevel != null){
            this.agentLevelStr = agentLevel.getDesp();
        }
    }

    public void setIsEnable(IsEnableEnum isEnable){
        this.isEnable = isEnable;
        if(isEnable != null){
            this.isEnableStr = isEnable.getDesp();
        }
    }

    public void setIsOfficial(IsOfficialEnum isOfficial){
        this.isOfficial = isOfficial;
        if(isOfficial != null){
            this.isOfficialStr = isOfficial.getDesp();
        }
    }
}
